package com.leo.auth.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户
 * </p>
 *
 * @author Leo
 * @since 2021-04-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="User对象", description="用户")
public class User implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "用户id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;

    @ApiModelProperty(value = "用户名（昵称）")
    private String username;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "MD5加密密码")
    private String password;

    @ApiModelProperty(value = "头像")
    private String avatar;

    @ApiModelProperty(value = "账号是否可用：默认为1（可用）0（不可用）")
    private Boolean enabled;

    @ApiModelProperty(value = "是否过期：默认为1（没有过期）0（过期）")
    private Boolean accountNonExpired;

    @ApiModelProperty(value = "账号是否锁定：默认为1（没有锁定）0（锁定）")
    private Boolean accountNonLocked;

    @ApiModelProperty(value = "证书（密码）是否过期：默认为1（没有过期）0（过期）")
    private Boolean credentialsNonExpired;

    @ApiModelProperty(value = "上一次登录时间")
    private LocalDateTime lastLoginTime;

    @ApiModelProperty(value = "登录ip")
    private String loginIp;


}
